Skip to content

Google ADK Tool Instrumentation#1768

Merged
TimPansino merged 6 commits into
develop-google-adkfrom
feat-google-adk-tool-instrumentation
Jun 24, 2026
Merged

Google ADK Tool Instrumentation#1768
TimPansino merged 6 commits into
develop-google-adkfrom
feat-google-adk-tool-instrumentation

Conversation

@TimPansino

@TimPansino TimPansino commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Overview

  • Add instrumentation for Google ADK Tools

@TimPansino TimPansino requested a review from a team as a code owner June 16, 2026 18:55
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 8 0 0 1.23s
✅ MARKDOWN markdownlint 7 0 0 0 1.39s
✅ PYTHON ruff 1047 0 0 0 1.28s
✅ PYTHON ruff-format 1047 0 0 0 0.42s
✅ YAML prettier 20 0 0 0 1.71s
✅ YAML v8r 20 0 0 6.44s
✅ YAML yamllint 20 0 0 0.81s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@mergify mergify Bot added the tests-failing Tests failing in CI. label Jun 16, 2026
@codecov-commenter

codecov-commenter commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 21 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop-google-adk@fef8ce4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
newrelic/hooks/mlmodel_googleadk.py 76.66% 12 Missing and 9 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             develop-google-adk    #1768   +/-   ##
=====================================================
  Coverage                      ?   81.62%           
=====================================================
  Files                         ?      216           
  Lines                         ?    26602           
  Branches                      ?     4193           
=====================================================
  Hits                          ?    21715           
  Misses                        ?     3469           
  Partials                      ?     1418           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread newrelic/hooks/mlmodel_googleadk.py Outdated
Comment thread newrelic/hooks/mlmodel_googleadk.py Outdated
Comment thread newrelic/hooks/mlmodel_googleadk.py Outdated
except Exception:
_logger.warning(TOOL_EXTRACTOR_FAILURE_LOG_MESSAGE, exc_info=True)

func_name = callable_name(wrapped)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our agent spec, it's not a requirement that we include the full callable name in the function trace name. Since this one is pretty long, I'm wondering if we're better off just using the name of the wrapped function. The goal with using the full name was more so to disambiguate the function name so the customer is clear what function was wrapped.

Comment thread newrelic/hooks/mlmodel_googleadk.py Outdated

ft = FunctionTrace(name=function_trace_name, group="Llm/tool/GoogleADK")
ft.__enter__()
ft._add_agent_attribute("subcomponent", json.dumps(agentic_subcomponent_data))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward, we will ideally only want to send the subcomponent attr if we have a local tool executing. Is there a way in the ADK repo to distinguish between remote and local tools and executions vs invocations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to remote vs local, it's distinguishable by class. I've added a gate for this to only add subcomponent to local tools.

I'm not sure what executions vs invocations means in the context of tools here though.

@TimPansino TimPansino force-pushed the feat-google-adk-tool-instrumentation branch from c4fff3f to 191c655 Compare June 24, 2026 21:50
Comment on lines +159 to +160
transaction.add_ml_model_info("GoogleADK", GOOGLEADK_VERSION)
transaction._add_agent_attribute("llm", True)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@umaannamalai Was this part necessary for tools? I'm pretty sure this is the result of a merge conflict but not certain.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually have been emitting this metric in the tools instrumentation also for other agentic frameworks. The idea was that we'd still get the AI Responses tab to appear if the tool instrumentation was hit independent of the agents instrumentation.

@mergify

mergify Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify mergify Bot removed the tests-failing Tests failing in CI. label Jun 24, 2026
@TimPansino TimPansino merged commit 2509eff into develop-google-adk Jun 24, 2026
111 of 115 checks passed
@TimPansino TimPansino deleted the feat-google-adk-tool-instrumentation branch June 24, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants